﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuanLyBanHang_NewApp.Entity
{
    public class KhachHang
    {
        private long maKH;
        private string hoTen, dienThoai, diaChi, soCMT;
        private TheTichDiem the;

        public KhachHang()
        {

        }
        public KhachHang(long ma, string hoten, string dt, string dc, string cmt, string mathe, string sotien)
        {
            maKH = ma;
            hoTen = hoten;
            dienThoai = dt;
            diaChi = dc;
            soCMT = cmt;
            the = new TheTichDiem(mathe, long.Parse(sotien));
        }

        public string getAttribute(int index)
        {
            switch (index)
            {
                case 0: return maKH.ToString();
                case 1: return hoTen;
                case 2: return dienThoai;
                case 3: return diaChi;
                case 4: return soCMT;
                case 5: return the.getAttribute(0);
                case 6: return the.getAttribute(1);
                default: return "!error";
            }
        }

        public string toString()
        {
            return "Mã khách hàng: " + maKH.ToString() + "\nHọ tên KH: " + hoTen+"\nĐịa chỉ: "+diaChi+"\nTiền trong thẻ: "+the.getAttribute(1);
        }
    }
}
